package nl.windgazer.arachne.services.messages;

import java.io.IOException;
import java.util.List;
import java.util.Locale;

import org.apache.tapestry5.ioc.Messages;
import org.apache.tapestry5.ioc.OrderedConfiguration;
import org.apache.tapestry5.ioc.Resource;

public interface MessageInterceptorStorage {

	public Messages getMessages(Locale locale);

	/**
	 * Add a new translation to the in-memory storage
	 * @param key
	 * @param value
	 * @param pageName
	 * @param locale
	 */
	public void addMsg(String key, String value, String pageName, Locale locale);
	
	/**
	 * Get an overview of all current translations still in memory.
	 * @return
	 */
	public List<TranslatedMessageVO> getAllTranslatedMessages();

	/**
	 * Save the current translations to persistence.
	 * @throws IOException 
	 */
	public void save( ) throws IOException;

	/**
	 * A method to notify this service of all the known message sources.
	 * 
	 * @param all
	 * @param t5aTranslation
	 * @return
	 */
	public boolean addKnownMessageResource(OrderedConfiguration<Resource> all, Resource t5aTranslation);

}
